library(DeclareDesign)
library(rdss)
library(tidyverse)
library(scales)
library(ggdag)
library(ggraph)
library(ggforce)
library(ggtext)

source("code/utilities/make_dag_df.R")

dag <- dagify(Y ~ W + M,
              M ~ X + W)
nodes <-
  tibble(
    name = c("X", "M", "W", "Y"),
    label = c("X", "M", "W", "Y"),
    annotation = c(
      "**Causal variable**",
      "**Hoop clue**",
      "**Smoking gun clue**",
      "**Outcome variable**"
    ),
    x = c(1, 3, 3, 5),
    y = c(1.5, 1.5, 3.5, 1.5), 
    nudge_direction = c("S", "S", "N", "S"),
    data_strategy = "unmanipulated",
    answer_strategy = "uncontrolled"
  )
ggdd_df <- make_dag_df(dag, nodes)
g <- base_dag_plot %+% ggdd_df

g

ggsave("figures/figure_16.1.pdf", g, width = 6.5, height = 4)
ggsave("figures/figure_16.1.svg", g, width = 6.5, height = 4)

